package com.KKd.demo02;

/**
 * @author 14587
 * @date 2020/11/3 0:06
 */
//静态代理模式
public class UserServiceImplProxy implements UserService{
    private UserServiceImpl userServiceImpl;

    public void setUserService(UserServiceImpl userServiceImpl) {
        this.userServiceImpl = userServiceImpl;
    }

    public void add() {
        log("add");
        userServiceImpl.add();
    }

    public void delete() {
        log("delete");
        userServiceImpl.delete();
    }

    public void update() {
        log("update");
        userServiceImpl.update();
    }

    public void query() {
        log("query");
        userServiceImpl.query();
    }

    public void log(String msg){
        System.out.println("这是一个"+msg+"方法");
    }
}
